<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>text</title>
  <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
  </script>
  <style>
      p{
       /* position: absolute;*/
        background: yellow;
        padding: 5px;
        overflow: hidden;
      }
  </style>
</head>
<body>
 <textarea id="t_1" style="width: 100%;height: 100%"></textarea>

<button id="bt">点我</button>
</body>
<script>
$("button").click(function(){
  alert($("t_1").text())
})

$('textarea').each(function () {
  this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
  this.setAttribute('style', 'height:' + (this.scrollLeft) + 'px;overflow-x:hidden;');
}).on('input', function () {
  this.style.height = 'auto';
  this.style.width = 'auto';
  this.style.height = (this.scrollHeight) + 'px';
  this.style.Left = (this.scrollLeft) + 'px';
});

</script>
</html>